package com.liangzhong.modules.youngTrain.command
{
	import com.liangzhong.constants.ApplicationConstants;
	import com.liangzhong.proxy.youngTrain.YoungTrainProxy;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	/**
	 *青训营 
	 * @author lake
	 * 
	 */	
	public class YoungTrainCommand extends SimpleCommand
	{
		public function YoungTrainCommand()
		{
			super();
		}
		override public function execute(notification :INotification):void
		{
			var proxy :YoungTrainProxy = facade.retrieveProxy(YoungTrainProxy.ProxyName) as YoungTrainProxy;
			switch(notification.getName())
			{
				case ApplicationConstants.YOUNGTRAIN_GET_INFO://获取青训营信息
				{
					proxy.getYoungTrainInfo(notification.getBody());
					break;
				}
				case ApplicationConstants.YOUNGTRAIN_GRADE_UP://升级
				{
					proxy.gradeUp();
					break;
				}
				case ApplicationConstants.YOUNGTRAIN_ADD_PLAYER://添加球童
				{
					proxy.addPlayer();
					break;
				}
				case ApplicationConstants.YOUNGTRAIN_GET_PLAYER_ALL://全部签约
				{
					proxy.getPlayers(notification.getBody() as Array);
					break;
				}
				case ApplicationConstants.YOUNGTRAIN_GET_PLAYER://签约
				{
					proxy.getPlayers(notification.getBody() as Array);
					break;
				}
				case ApplicationConstants.YOUNGTRAIN_SALE_PLAYER://出售
				{
					proxy.salePlayer(notification.getBody() as int);
					break;
				}
				case ApplicationConstants.YOUNGTRAIN_GROW_ACC://加速成长
				{
					proxy.growAcc(notification.getBody() as int);
					break;
				}
				case ApplicationConstants.YOUNGTRAIN_ADD_GROW_NUM://增加球童生产次数
				{
					proxy.addPlayerGrowNum();
					break;
				}
			}
		}
	}
}